package com.hemaapp.yjnh.view.singlewheel;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.Display;
import android.view.WindowManager;

/**
 * 类描述：
 * 创建人：GuiyouZhang
 * 创建时间：2016/6/30 13:44
 * 修改备注：
 */
public class ProvinceLoopView extends LoopView {
    public ProvinceLoopView(Context context) {
        super(context);
    }

    public ProvinceLoopView(Context context, AttributeSet attributeset) {
        super(context, attributeset);
    }

    public ProvinceLoopView(Context context, AttributeSet attributeset, int defStyleAttr) {
        super(context, attributeset, defStyleAttr);
    }

    @Override
    public void measureTextWidthHeight() {
        Rect tempRect = new Rect();
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        Display display = windowManager.getDefaultDisplay();

        paintCenterText.getTextBounds("\u661F\u671F", 0, 2, tempRect); // 星期
        maxTextWidth = display.getWidth()/3 - paddingLeft - paddingRight;
        int textHeight = tempRect.height();
        if (textHeight > maxTextHeight) {
            maxTextHeight = textHeight;
        }
    }
}
